<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> 表单验证 </title>
</head>
<body>
    <form action="" method="GET" >
        <div>
            <label for=""> 账户</label>
            <input type="text" name="username"  >
        </div>
        <div>
            <label for=""> 密码</label>
            <input type="password" name="password"  >
        </div>
        <div>
            <label for=""> 邮箱</label>
            <input type="text" name="email"   >
        </div>
        <div>
            <button >登录</button>
        </div>
    </form>
    
</body>
<script src="../lib/font/jquery.min.js"></script>
<script>
    
    $(function(){
        $("form").submit(function(){
            let pass = true;

        let username = $("input[name='username']").val();
        let password = $("input[name='password']").val();
        let email = $("input[name='email']").val();

        if(username.length < 3 || username.length > 20){
            alert("用户名应为3~20位长度");
            pass = false;
        };
        if(pass < 3 && password.length <6){
            alert("密码应该大于六位");
            pass = false;
        }
        // if( pass&& (email.in)){
        //     alert("用户名应为3~20位长度");
        //     pass = false;
        // }


      return passs;


        })
       

        
    });
</script>
</html>